﻿using System.Collections.Generic;
using PaceR.Core.Interfaces.PatternMatching;

namespace PaceR.Core.PatternMatching
{
    public class GenericPatternMatcher<T> : IPatternMatcher<T>
    {
        public GenericPatternMatcher()
            : this(default(T))
        { }

        public GenericPatternMatcher(T pattern)
        {
            Pattern = pattern;
        }

        #region IPatternMatcher<T> Members

        public virtual T Pattern { get; set; }

        public virtual bool Match(T testParam)
        {
            return EqualityComparer<T>.Default.Equals(testParam, Pattern);
        }

        #endregion
    }
}
